package com.hospital.demo.mapper.libokun;

import com.hospital.demo.model.libokun.DrugBuy;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface DrugBuyMapper {

    //查询全部进货单信息
    @Select("SELECT * from drugsbuy")
    List<DrugBuy> SelectAllBuy();
    //按ID查询药品信息
    @Select("SELECT * from drugsbuy where drugsbuy.drbid=#{drbid}")
    List<DrugBuy>SelectByBId(@Param("drbid") Integer drbid);

    //删除进货单
    @Delete("delete from drugsbuy where drugsbuy.drbid=#{drbid}")
    Integer DelectBuy(@Param("drbid") Integer drbid);
    //填写进货单
    @Insert("INSERT into drugsbuy values(Null,#{drugbuy.drbname},#{drugbuy.drbnumber},#{drugbuy.drbpricein},#{drugbuy.drbdate})")

    List<DrugBuy>InsertBuy(@Param("drugbuy") DrugBuy drugbuy);
}
